clear all; clc;RC = 1e-6;
a = [RC 1];
b = [1];
freqs(b, a);


clear all;clc;close all;

RC=1e-6

a=[RC 1 ];b=[1];
Fs=100; Fmax=4e5 ; f=0:Fs:Fmax ;
H=freqs(b,a,2*pi*f)

figure(1);subplot(2,1,1);
plot(f/1e6,20*log10(abs(H)));
subplot(2,1,2);
plot(f/1e6,rad2deg(unwrap(angle(H))))


RC = 1e-6; a = [RC 1]; b = [1];
sys = tf(b,a);
[y,t] = impulse(sys);
[y,t] =impulse(sys);
figure(3); plot(t, y);
xlabel('t, s'); ylabel('h(t)');
grid on


clear all; clc
a = [1 -0.4]; b = [0.6];
[z, p, k] = tf2zp(b, a);
% zplane(b, a);
zplane(z, p);

clear all; clc

x = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
km = 1:length(x);
for k = km
if k > 1
    y(k) = 0.7*y(k-1) +0.3*x(k)
else
    y(k) = 0.3*x(k);
end
end
figure(4); stem(km,y)